#include "mainwindow.h"
#include "startmenu.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent) {
    gameWidget = new GameWidget(this);
    setCentralWidget(gameWidget);
    setWindowTitle("飞机大战");
    setFixedSize(800, 600);
}

void MainWindow::showGame() {
    gameWidget->startGame();
    gameWidget->setFocus(); // 强制聚焦到游戏窗口
    show();
}
